package com.mcj.tokendemo.controller;

import com.mcj.tokendemo.entity.ResponseResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
	
	@RequestMapping("/hello")
	@PreAuthorize("@mcj.hasAuthority('system:dept:list')")
//	@PreAuthorize("hasAuthority('system:dept:list')")
	public String hello() {
		return "hello,security";
	}
	
	@RequestMapping("/testCors")
	public ResponseResult testCors() {
		return new ResponseResult(200, "testCors");
	}
}
